import java.util.Calendar;

public class Item{
	
	protected int index; 
	protected String description;
	protected Calendar date;
	
	public Item(String description, Calendar date,int index) {
		this.set(description, date);
		this.index=index;
	}

	public void set(String description, Calendar date){
		setDescription(description);
		setDate(date);
	}
	
	public int getIndex(){
		return index;
	}
	
	public void setIndex(int index){
		this.index=index; 
	}
	
	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Calendar getDate() {
		return date;
	}

	public void setDate(Calendar date) {
		this.date = date;
	}
	
	//date format : Wed Mar 06 16:03:49 SGT 2013
	public void setDate(String date){
		String calFields[] = date.split(" ");
		String timeFields[] = calFields[3].split(":");
		Calendar c = Calendar.getInstance();
		
		c.set(Integer.parseInt(calFields[5]), Integer.parseInt(calFields[2]), Integer.parseInt(calFields[3]),
				Integer.parseInt(timeFields[0]), Integer.parseInt(timeFields[1]),Integer.parseInt(timeFields[2] ));		
	}


	public void print(){
		System.out.println(index+" "+description);
	}
	
}